<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>帮助设置</title>
    <link href="/assets/css/text.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/main.css" rel="stylesheet" type="text/css">
    <link href="/assets/css/content.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" href="/assets/themes/default/default.css"/>
    <script charset="utf-8" src="/assets/kindeditor-min.js"></script>
    <script charset="utf-8" src="/assets/lang/zh_CN.js"></script>
    <script>
        var editor;
        KindEditor.ready(function (K) {
            editor = K.create('textarea[name="content"]', {
                    cssPath : ['/assets/plugins/code/prettify.css', 'index.css'],
                    afterBlur: function(){this.sync();}
            });
        });
    </script>
    <style>
        form {
            margin: 0;
        }

        textarea {
            display: block;
        }

        #alien table {
            text-align: center;

        }

        #title {
            width: 92%;
            border: 0px;
            margin-bottom: 10px;
        }

        #title td {
            text-align: center;
            height: 20px;
            line-height: 150%
        }

        #title div {
            background-image: url(/assets/img/dot_02.gif);
            background-position: left top;
            background-repeat: no-repeat;
            margin: 0 auto;
            padding-left: 20px;
            text-align: left;
            width: 10%;
            font-size: 15px;
            font-weight: bold;
            color: #CC0000;
            letter-spacing: 2px;
        }
    </style>
    <script>
        function change() {
            document.form1.method = "get";
            document.form1.action = "/helpset.do";
            document.form1.submit();
        }
        <c:if test="${not empty requestScope.success}">
        alert("${requestScope.success}");
        </c:if>
    </script>

</head>
<body>
<table cellspacing="0" cellpadding="0" id="title" align="center">
    <tbody>
    <tr>
        <td nowrap="nowrap">
            <div> 帮助页面设置</div>
        </td>
    </tr>
    </tbody>
</table>
<table cellpadding="0" cellspacing="0" class="datalist" align="center" id="alien">
    <tbody>
    <tr>
        <th>页面</th>
        <td>
            <form name="form1">
                <select name="groupId" onchange="change()">
                    <c:forEach items="${group}" var="g">
                        <option value="<c:out value="${g.key}"/>"<c:if test="${g.key==param.groupId}"><c:out value=" selected = 'selected'  "></c:out></c:if>><c:out value="${g.value}"/></option>
                    </c:forEach>
                </select>
            </form>
        </td>
    </tr>
    <form name="form2" action="/savehelp.do" method="post">
        <c:forEach items="${help}" var="h">
            <input type="hidden" value="${h.groupId}" name="groupId" />
            <tr>
                <th>页面标题</th>
                <td><input type="text" name="txtname" value="${h.name}"></td>
            </tr>
            <tr>
                <th>页面内容</th>
                <td>
                    <textarea id="content" name="content" style="width:1000px;height:350px;visibility:hidden;">${h.acticle}</textarea>
                </td>
            </tr>
        </c:forEach>
        <tr align="center">
            <td align="center" colspan="2"><input type="submit" value="发布" class="button"></td>
        </tr>
    </form>
    </tbody>
</table>
<br>
</body>
</html>